'use strict'


import Http from '../kit/HttpKit'
import Api from './Api'
import store from '../store/index'



/**
* 首页模块
**/
const sta = (data, callback)=>{
	var url = Api.API_URL + '/home/sta';

	data.api_token = Api.getApiToken();
	data.api_user_id = Api.getApiUserId();

	Http.post(url, data, json=>{
		Api.getDataCB(json, callback);
	});
}

const integral = (data, callback)=>{
	var url = Api.API_URL + '/home/integral';

	data.api_token = Api.getApiToken();
	data.api_user_id = Api.getApiUserId();
	data.userphone = store.state.user.userPhone;
	data.pageNum = 0;
	data.pageSize = 50;
	
	Http.post(url, data, json=>{
		Api.getDataCB(json, callback);
	});
}

export default{
	sta,
	integral
}
